package com.tedu.api;

import org.junit.Test;

public class ikun作业 {
    @Test
    public void test1() {
        String a1 = "HelloJava";
        System.out.println(a1.length());
    }

    @Test
    public void test2() {
        String a2 = "HelloJava";
        int index = a2.lastIndexOf("o");
        System.out.println("最后出现位置：" + index);
    }

    @Test
    public void test3() {
        String str = "HelloJava";
        int index = str.indexOf("o");
        System.out.println("返回坐标位置：" + index);
    }

    @Test
    public void test4() {
        String url = "HelloJava";
        String s = url.substring(0, 5);
        System.out.println("截取后的子字符串：" + s);

    }

    @Test
    public void test5() {
        String q = "HelloJava";
        String t = q.substring(5, 9);
        System.out.println("截取后的子字符串：" + t);

    }

    @Test
    public void text6() {
        String str = " HelloJava ";
        str = str.trim();
        System.out.println(str);
    }

    @Test
    public void text7(){
        String str="HelloJava";
        char a=str.charAt(5);
        System.out.println("获取的字符是："+a);

    }

    @Test
    public void test8(){
        String str="HelloJava";
        str=str.toLowerCase().trim();
        System.out.println("转换为小写："+str);
        str=str.toUpperCase();
        System.out.println("转换为大写："+str);
    }
}